ATM Central Server - persistent
layer
This is the persistent layer of the ATM Central Server (atmcs).
The object design contains a binary association class (Session)
in the center, surrounded with several collection managers. It is
a straightforward implementation of the design in the Case Study: ATM System
Software - Part 5 (also see exercise 7-4). This example demonstrates
how to:
-
Design persistent objects with a binary assocation class
-
Implement persistent objects and database root
-
Implement a simple terminal session with transaction blocks
Source Files
-
ATMManager.java
This is the database root of the persistent layer. It contains
four collections of persistent objects (BankInfo, Session, Card, DailyLog)
and a pretty standard set of management functions for the collections.
A static method runTerminal is used to run a console session for direct
access to the database by an administrator (a login password "atmcs" is
needed).
One may also run the code with an input text file that contains multiple
command lines. An example is in bankData.txt.
To shutdown the program, type in "shutdown" from the console.
-
cfpargs
Lists all persistent enabled classes in this package. To be read
by the post processor during the build process.
Batch Files
-
build.bat
A batch file for building the persistent classes. A subdirectory
named "atmcs" will be created, which contains the class files. It
invokes the post processor to make the classes persistent.
It also builds a atmcs.jar file, which is used by the interface layer
(atmcs).
-
run.bat
A batch file for running the command line tool for administration.
The command line format is:
run [database_file] [command.txt]
If the optional database file name is present, it will create or open the
file and all updates will be recorded in the database. In addition,
an optional input command file such as bankData.txt
can be used to issue commands.
If the database file name is not present, it simply performs the tasks
on a set of transient objects.